import request from '../utils/request'

export const getReportingPage = (params) =>
  request({ url: '/reporting', method: 'get', params })

export const addReporting = (data) =>
  request({ url: '/reporting', method: 'post', data })

export const updateReporting = (data) =>
  request({ url: '/reporting', method: 'put', data })

export const deleteReporting = (id) =>
  request({ url: `/reporting/${id}`, method: 'delete' })

export const batchDeleteReporting = (ids) =>
  request({ url: '/reporting/batch', method: 'delete', data: ids })

export const exportReporting = () =>
  request({ url: '/reporting/export', method: 'get', responseType: 'blob' })

export const importReporting = (file) =>
  request({
    url: '/reporting/import',
    method: 'post',
    data: file,
    headers: { 'Content-Type': 'multipart/form-data' }
  })